/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package revisaosistematica;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 *
 * @author claudiane
 */
public class Util {

    public static void escreverSaidaTitle(String dados) {
        String arquivo = "./saidas/sem_titulos.txt";
        try {
            BufferedWriter bw = new BufferedWriter(new FileWriter(arquivo, true));
            bw.write(dados + "\n");
            bw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void escreverSaidaAbs(String dados) {
        String arquivo = "./saidas/sem_abstracts.txt";
        try {
            BufferedWriter bw = new BufferedWriter(new FileWriter(arquivo, true));
            bw.write(dados + "\n");
            bw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void escreverSaidaKey(String dados) {
        String arquivo = "./saidas/sem_key.txt";
        try {
            BufferedWriter bw = new BufferedWriter(new FileWriter(arquivo, true));
            bw.write(dados + "\n");
            bw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void escreverSaidaRanking(String dados) {
        String arquivo = "./saidas/ranking.csv";
        try {
            String cabecalho = "posicao;numero;rank;titulo\n";
            BufferedWriter bw = new BufferedWriter(new FileWriter(arquivo));
            bw.write(cabecalho);
            bw.write(dados);
            bw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
